{template 'common/header'}
<style>
    a:hover {
        color: white;
        text-decoration: underline;
    }
</style>
<script>
    $(function(){
        $(".find").on('click',function(){
            find();
        })
    });
    function find(){
        var express_no = $("#express_no").val();
        var key_word = $("#key_word").val();
        var order_day = $("#order_day").val();
        var company_id = $("#company_id").val();
        var server_id = $("#server_id").val();
        location.href="{php echo $this->createWebUrl('sign')}&express_status={$express_status}&express_no="+express_no+"&key_word="+key_word+"&order_day="+order_day+"&company_id="+company_id+"&server_id="+server_id;
    }
</script>
<ul class="nav nav-tabs">
    <li {if $express_status == 1} class="active" {/if}><a href="{php echo $this->createWebUrl('sign', array('op'=>'index'))}">未签收</a></li>
    <li {if $express_status == 2} class="active" {/if}><a href="{php echo $this->createWebUrl('sign', array('op'=>'index','express_status' => 2))}">已签收</a></li>
</ul>
<div>
    <div class="row">
        <div class="col-xs-2">
            <input type="text" class="form-control" placeholder="快递单号" id="express_no" value="{$express_no}" />
        </div>
        <div class="col-xs-2">
            <input type="text" class="form-control" placeholder="客户名称/助记码/电话" id="key_word" value="{$key_word}" />
        </div>
        <div class="col-xs-4">
            <div class="col-xs-4">订单日期</div>
            <div class="col-xs-8">
                <input type="date" class="form-control" id="order_day" value="{$order_day}" />

            </div>
        </div>
        <div class="col-xs-2">
            <select class="form-control" id="company_id">
                <option value="0">快递公司</option>
                {loop $companys $company}
                <option value="{$company['id']}" {if $company_id == $company['id']} selected="selected" {/if}>{$company['name']}</option>
                {/loop}
            </select>
        </div>
        <div class="col-xs-2">
            <select class="form-control" id="server_id">
                <option value="-1">服务社</option>
                {loop $servers $server}
                <option value="{$server['id']}" {if $server_id == $server['id']} selected="selected" {/if}>{$server['name']}</option>
                {/loop}
            </select>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-xs-2">
            <button class="btn btn-primary find">搜索</button>
        </div>
    </div>
    <br />
    {if $express_status == 1}
    <div>
        {loop $list $l}
        <a href="{php echo $this->createWebUrl('sign',array('op' => 'detail', 'id' => $l['id'],'express_status' => $express_status))}">
            <div class="panel panel-primary" order_id="{$l['id']}">
                <div class="panel-heading">
                    <div class="panel-title row">
                        <div class="col-xs-4">{$l['name']}</div>
                        <div class="col-xs-4">
                            电话
                            <a href="tel:{$l['phone']}">
                                {$l['phone']}
                            </a>
                        </div>
                        <div class="col-xs-4">{$l['day']}</div>

                    </div>

                </div>
            </div>
        </a>
        {/loop}
        <div>{$pager}</div>
    </div>
    {else if $express_status == 2}
    <div>
        <table class="table">
            <tr>
                <th>客户</th>
                <th>电话</th>
                <th>服务社</th>
                <th>签收日期</th>
                <th>签收人</th>
                <th>总件数</th>
                <th>总运费</th>
                <th>代付款</th>
                <th>订单日期</th>
                <th>备注</th>
            </tr>
            {loop $list $l}
            <tr>
                <td>{$l['name']}</td>
                <td>{$l['phone']}</td>
                <td>{$l['server']}</td>
                <td>{$l['get_day']}</td>
                <td>{$l['get_name']}</td>
                <td>{$l['numbers']}</td>
                <td>{$l['total_freight']}</td>
                <td>{$l['gen_pay']}</td>
                <td>{$l['day']}</td>
                <td>{$l['remark']}</td>
            </tr>
            {/loop}
        </table>
        <div>{$pager}</div>
    </div>
    {/if}
</div>




{template 'common/footer'}